<!DOCTYPE　html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>

<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/2/5 0005
 * Time: 22:12
 */


$a="123";//设置密码
@$name=$_POST['name'];
if(empty($_POST['name'])){

}else{
    session_start();
    if($a==$name){

       $_SESSION['name']=$name;

        header("Location:admin.php");//跳转的页面
    }else{
        echo '错误';
    }

}


?>
<form action="index.php" method="post">
    <input type="text" name="name">
    <input type="submit" value="提交">
</form>
</body>
</html>
